#include "gui/SubWindow/AskConvertConfig.h"
#include "gtkmm/stock.h"

const std::string LABEL_TEXT = "Nombre del nuevo diagrama";
const std::string TITLE_TEXT = "Configuracion para conversion";

AskConvertConfig::AskConvertConfig() : m_label(LABEL_TEXT) {
	m_dialog.set_title(TITLE_TEXT.c_str());
	m_dialog.get_vbox()->pack_start(m_label, true, true , 5);
	m_dialog.get_vbox()->pack_start(m_nameEntry, true ,true, 5);


	m_radioButtons[0] = new Gtk::RadioButton(m_radio, "Conversion tipo A");
	m_radioButtons[1] = new Gtk::RadioButton(m_radio, "Conversion tipo B");
	m_radioButtons[2] = new Gtk::RadioButton(m_radio, "Conversion tipo C");
	m_radioButtons[0]->set_active();

	m_dialog.get_vbox()->pack_start(*m_radioButtons[0], true ,true, 5);
	m_dialog.get_vbox()->pack_start(*m_radioButtons[1], true ,true, 5);
	m_dialog.get_vbox()->pack_start(*m_radioButtons[2], true ,true, 5);


	m_dialog.add_button( Gtk::Stock::OK, Gtk::RESPONSE_OK);
	m_dialog.add_button( Gtk::Stock::CANCEL, Gtk::RESPONSE_CANCEL);
	m_nameEntry.set_activates_default();
	m_dialog.set_response_sensitive(Gtk::RESPONSE_OK);
	m_dialog.set_default_response(Gtk::RESPONSE_OK);
}

AskConvertConfig::~AskConvertConfig() { }

int AskConvertConfig::askConfig(){
    m_dialog.show_all();
    int res = m_dialog.run();
    if ( res == Gtk::RESPONSE_OK){
        return 1;
    }
    return 0;
}

